package br.com.winesys.geta;

import java.awt.Dimension;
import java.awt.Window;
import javax.swing.JComponent;
import br.com.winesys.geta.crud.CadastroPopup;
import br.com.winesys.geta.crud.CadastroTabela;
import br.com.winesys.geta.crud.CadastroUnico;
import br.com.winesys.geta.databinding.component.selector.JPAObjectSelector;
import br.com.winesys.geta.databinding.component.table.TableModel;
import br.com.winesys.geta.editor.Editor;

public final class GeTA {

    private GeTA() {
    }

    public static <T> Editor<T> createEditor(final Class<T> entityClass) {
        return ObjectEditorBuilder.createEditor(entityClass);
    }

    public static <T> Editor<T> createEditor(JComponent component){
        return ObjectEditorBuilder.createEditor(component);
    }

    public static <T> TableModel<T> createTableModel(final Class<T> entityClass) {
        return TableModelBuilder.createTableModel(entityClass);
    }

    public static <T> JPAObjectSelector<T> createObjectSelector(final Class<T> entityClass) {
        return ObjectSelectorBuilder.createSelector(entityClass);
    }

    public static <T> CadastroUnico<T> createCadastroUnico(final Class<T> entityClass, final Window owner, final String title) {
        return CadastroBuilder.createCadastroUnico(entityClass, owner, title);
    }

    public static <T> CadastroPopup<T> createCadastroPopup(final Class<T> entityClass, final Window owner, final String title, Dimension size) {
        return CadastroBuilder.createCadastroPopup(entityClass, owner, title, size);
    }

    public static <T> CadastroTabela<T> createCadastroTabela(final Class<T> entityClass, final Window owner, final String title, Dimension size) {
        return CadastroBuilder.createCadastroTabela(entityClass, owner, title, size);
    }
}
